<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AlterTableUserContractAddColumns extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('open_shop_user_contract', function (Blueprint $table) {
            $table->unsignedTinyInteger('isDeleted')->default(0)->comment('');
            $table->unsignedTinyInteger('contractStatus')->default(0)->comment('合同状态 0 - 正常 1 - 作废')
                  ->after("exceptionMsg");
            $table->unsignedInteger('invalidedTime')->default(0)->comment('作废时间')
                  ->after("exceptionMsg");
            $table->unsignedTinyInteger('invalidedUid')->default(0)->comment('作废用户')
                  ->after("exceptionMsg");

            $table->string("categoryId", 36)->default("")->comment("合同业务id")->after("id");
            $table->string("categoryName", 120)->default("")->comment("合同业务名称")->after("id");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('open_shop_user_contract', function (Blueprint $table) {
            $table->dropColumn('isDeleted');
            $table->dropColumn('contractStatus');
            $table->dropColumn('invalidedTime');
            $table->dropColumn('invalidedUid');
            $table->dropColumn('categoryId');
            $table->dropColumn('categoryName');

        });
    }
}
